package com.yanqu.road.entity.enums.activity.dafuweng;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author wpj
 * @Date 2020/10/3
 */
public enum eDaFuWengEventType {
    Normal("普通事件", 1),
    ZaoYao("造谣事件", 2),
    StartReward("起点奖励事件", 3),
    CollectGoods("收集事件", 4),
    RecoverPower("体力恢复事件", 5),
    Secret("神秘事件", 6),
    Empty("空事件", 7),
    Trade("贸易事件", 8),
    Package("礼包事件", 9),
    Boss("BOSS事件", 10),
    Box("宝箱事件", 11),
    Vehicle("坐骑事件", 12),
    God("请神事件", 13),
    Cal("算卦事件", 14),
    Blacksmith("铁匠事件", 15),


    Roadblocks("路障事件（卡片）", 16),
    YongBing("佣兵事件（卡片）", 17),
    ZhuiBu("追捕事件（卡片）", 18),
    ZhuFu("祝福事件（卡片）", 19),


    MapSkill("地图效果", 20),
    BattleSkill("其利断金", 21),
    OpenBoxSkill("开箱大吉", 22),
    RecoverySkill("恢复技能", 23),
    DollSkill1("人偶技能1", 24),
    DollSKill2("人偶技能2", 25),
    GodSkill("神仙技能", 26),
    MoveSkill("坐骑技能", 27),

    ;

    private String name;

    private int intValue;

    eDaFuWengEventType(String name, int value) {
        intValue = value;
        this.name = name;
    }

    public int getValue() {
        return intValue;
    }

    public String getName() {
        return name;
    }

    // 方便按值取类型
    private static Map<Integer, eDaFuWengEventType> map = new ConcurrentHashMap<>();

    static {
        for (eDaFuWengEventType type : eDaFuWengEventType.values()) {
            map.put(type.getValue(), type);
        }
    }

    public static eDaFuWengEventType getTypeByValue(int value) {
        return map.get(value);
    }

    /**
     * 是否是家族事件
     *
     * @param type
     * @return
     */
    public static boolean isUnionEvent(eDaFuWengEventType type) {
        if (type == ZaoYao) {
            return true;
        }
        return false;
    }
}
